import QtQuick 2.2
/*
* 定位器Row，Row沿着一行安置它的孩子们，在你需要水平放置一系列的Item时，它比锚布局更加方便。
*/

Rectangle {
	width: 360;
	height: 240;
	color: "#EEEEEE";
	id: rootItem;

	Text {
		id: centerText;
		text: "A Single Text.";
		anchors.centerIn: parent;
		font.pixelSize: 24;
		font.bold: true;
	}

	function setTextColor(clr) {
		centerText.color = clr;
	}

	Row {
		anchors.left: parent.left;
		anchors.leftMargin: 4;
		anchors.bottom: parent.bottom;
		anchors.bottomMargin: 4;
		spacing: 4;

		ColorPicker {
			color: Qt.rgba(Math.random(),Math.random(),Math.random(),1.0);
			onColorPicked: setTextColor(clr);
		}

		ColorPicker {
			color: Qt.rgba(Math.random(),Math.random(),Math.random(),1.0);
			onColorPicked: setTextColor(clr);
		}

		ColorPicker {
			color: Qt.rgba(Math.random(),Math.random(),Math.random(),1.0);
			onColorPicked: setTextColor(clr);
		}

		ColorPicker {
			color: Qt.rgba(Math.random(),Math.random(),Math.random(),1.0);
			onColorPicked: setTextColor(clr);
		}
	}
}
